package a入门.day6.数组工具类;

import java.util.Arrays;

public class 工具类的数组复制 {
    public static void main1(String[] args) {
        int[]src={2,3,1,56};
        int[]dst=new int[src.length];

        System.arraycopy(src,1,dst,1,src.length-1);
        System.out.println(Arrays.toString(dst));
    }

    public static void main(String[] args) {
        int[]src={2,3,1,56};
        int[]dst=Arrays.copyOf(src,src.length);
        System.out.println(Arrays.toString(dst));
    }
}
